<?php

Yii::import('common.models._base.BaseClassCourseContentLikeUnlike');

class ClassCourseContentLikeUnlike extends BaseClassCourseContentLikeUnlike {

    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    public static function likeClassCourseDescription($classId, $status,$type) {
        $remotIp = $_SERVER['REMOTE_ADDR'];
        $likeDesc = '';       
        $classDesc = ClassCourseContentLikeUnlike::model()->findByAttributes(array('ip_address' => $remotIp, $type => $classId));
        if (!empty($classDesc)) {
            $likeDesc = $classDesc->description_like;
        }
        return $likeDesc;
    }
    public static function UnlikeClassCourseDescription($classId, $status,$type) {
        $remotIp = $_SERVER['REMOTE_ADDR'];
        $likeDesc = '';       
        $classDesc = ClassCourseContentLikeUnlike::model()->findByAttributes(array('ip_address' => $remotIp, $type => $classId));
        if (!empty($classDesc)) {
            $likeDesc = $classDesc->description_unlike;
        }
        return $likeDesc;
    }
    
    public static function likeClassCourseStruture($classId, $status,$type) {
        $remotIp = $_SERVER['REMOTE_ADDR'];
        $likeDesc = '';       
        $classDesc = ClassCourseContentLikeUnlike::model()->findByAttributes(array('ip_address' => $remotIp, $type => $classId));
        if (!empty($classDesc)) {
            $likeDesc = $classDesc->structure_like;
        }
        return $likeDesc;
    }
    public static function UnlikeClassCourseStruture($classId, $status,$type) {
        $remotIp = $_SERVER['REMOTE_ADDR'];
        $likeDesc = '';       
        $classDesc = ClassCourseContentLikeUnlike::model()->findByAttributes(array('ip_address' => $remotIp, $type => $classId));
        if (!empty($classDesc)) {
            $likeDesc = $classDesc->structure_unlike;
        }
        return $likeDesc;
    }
    
    
     public static function likeClassCourseOutcome($classId, $status,$type) {
        $remotIp = $_SERVER['REMOTE_ADDR'];
        $likeDesc = '';       
        $classDesc = ClassCourseContentLikeUnlike::model()->findByAttributes(array('ip_address' => $remotIp, $type => $classId));
        if (!empty($classDesc)) {
            $likeDesc = $classDesc->outcome_like;
        }
        return $likeDesc;
    }
    public static function UnlikeClassCourseOutcome($classId, $status,$type) {
        $remotIp = $_SERVER['REMOTE_ADDR'];
        $likeDesc = '';       
        $classDesc = ClassCourseContentLikeUnlike::model()->findByAttributes(array('ip_address' => $remotIp, $type => $classId));
        if (!empty($classDesc)) {
            $likeDesc = $classDesc->outcome_unlike;
        }
        return $likeDesc;
    }

}